Skip to main content

Props Passed to App Component

The following properties (props) can be passed to the App component:

  • app: An object containing app-related information such as app_key, category, segment, version, and visibility.
  • rig: A data object loaded from the selected asset, specific to drilling apps. For completion apps, this could be FracFleet or wells.
  • isLoading: A boolean value indicating whether all necessary data for the app has been loaded.
  • coordinates: An object specifying the app's coordinates, including:
    • x, y: Position on the grid layout
    • w, h: Relative app width and height in grid units pixelWidth, pixelHeight: Actual app dimensions in pixels
  • currentUser: An object containing information about the logged-in user and their company.
  • toggleAppSettingsDialog: A function that toggles the visibility of the App Settings Dialog.
  • setMainMenuItems: A function that sets the app's main menu items, e.g., CSV export. For example:
const menus = [
{
icon: 'backup',
title: 'Import Model',
priority: false,
onClick: () => setImportDialogOpen(true),
},
];
setSecondaryMenuItems(menus);

App Action Button

app action button

The menu will appear as follows:

app menu

  • setSecondaryMenuItems – A function that sets additional menu items for the app.

secondary menu icon

  • onSettingsChange: A function that sets additional menu items for the app. For exapmple:
onSettingsChange({
isChecked: false,
});
  • onSettingChange: A callback function triggered when a single App Setting is changed. For example:
<Checkbox
checked={settings.isExampleCheckboxChecked}
onChange={e => onSettingChange('isExampleCheckboxChecked', e.target.checked)}
/>
  • appHeaderProps: An object containing app information similar to the App component.
  • isNative: A boolean indicating if the app is being accessed from a mobile device.
  • layoutEnvironment: An object containing a type property which could be either:
    • 'general': For general dashboards accommodating apps for various assets.
    • 'asset': For dashboards specific to a particular asset.
  • timestamp: A timestamp obtained from location.query.

Props that are passed to App Settings:

  • app: An object containing app information similar to the App component.
  • appData: A data object loaded based on the selected asset. The asset type (asset_id) is determined either from the general dashboard or from a specific asset dashboard.
  • appSettings: An object containing the settings for the app.
  • onSettingsChange: A callback function triggered when App Settings are altered.
  • onSettingChange: A callback function triggered when a single App Setting is changed.
  • layoutEnvironment: An object specifying the type of dashboard, similar to the App component.
  • currentUser: An object containing information about the logged-in user, similar to the App component.